package com.imooc.ad.dao;

import com.imooc.ad.entity.AdPlan;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * @author Qihs
 *
 * 关联的实体类定义<AdPlan, Long>
 */
public interface AdPlanRepository extends JpaRepository<AdPlan, Long>{

    //两个限制条件，Id与UserId
    AdPlan findByIdAndUserId(Long id, Long userId);

    List<AdPlan> findAllByIdAndUserId(List<Long> Ids, Long UserId);

    AdPlan findByUserIdAndPlanName(Long userId, String planName);

    List<AdPlan> findAllByPlanStatus(Integer status);
}
